<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   default_default
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
?>
<?php if (($_products = $this->getProductCollection()) && $_products->getSize()): ?>
<div > <!-- the class name will change to .listing-type-cell if viewing in list mode -->
<?php $_collectionSize = $_products->count() ?>
    <table cellspacing="0" id="product-list-table">
    <?php $i=0; foreach ($_products as $_product): ?>
    <?php if ($i++%3==0): ?>
    <tr>
    <?php endif ?>
        <td width="33.3%" height="280" align="center" valign="bottom">
            <table border="0" cellspacing="0" cellpadding="0" height="100%" width="100%"  valign="bottom">
            <tr><td height="10"></td></tr>
            <tr>
            <td align="center">
            <table border="0" cellspacing="0" cellpadding="0" height="100%" width="100%" align="center" valign="bottom">
            <tr>
            <td height="40"  align="center">
            <h5><a class="product" href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo $this->htmlEscape($_product->getName()) ?></a></h5>
            </td>
            </tr>
            <tr>
            <td align="center">
            <p class="product-image">
                <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>">
                    <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(170, 170); ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>"/>
                </a>
            </p>
            <?php //if($_product->getRatingSummary()): ?>
            <?php //echo $this->getReviewsSummaryHtml($_product, 'short') ?>
            <?php //endif; ?>
            </td>
            </tr>
            <tr>
            <td height="50"  align="center">
            <?php echo $this->getPriceHtmlSimple($_product, true) ?>
            <?php //if($_product->isSaleable()): ?>
            <a href="<?php echo $_product->getProductUrl() ?>"><img src="<?php echo $this->getSkinUrl('images/button_more.gif') ?>" alt="More Info"/></a>
            <?php //else: ?>
            <div class="out-of-stock"><?php //echo $this->__('Out of stock') ?></div>
            <?php //endif; ?>
            <div class="clear">Order:<?php echo number_format($_product->getOrderedQty());?></div>
            <?php
            /* 
            <ul class="add-to"> 
                <?php //if ($this->helper('wishlist')->isAllow()) : ?>
                <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>"><?php echo $this->__('Add to Wishlist') ?></a></li>
                <?php endif; ?>
                <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
                <li><a href="<?php echo $_compareUrl ?>"><?php echo $this->__('Add to Compare') ?></a></li>
                <?php endif; ?>
            </ul>
            */
            ?>
            </td>
            </tr>
            </table>
            </td>
            <td background="<?php echo $this->getSkinUrl('images/v_line.gif') ?>" width="1" rowspan="2"/>
            </td>
            </tr>
            <tr>
                <td height="1" background="<?php echo $this->getSkinUrl('images/h_line.gif') ?>"/>
            </tr>
            </table>
        </td>
    <?php if ($i%3==0 && $i!=$_collectionSize): ?>
    </tr>
    <?php endif ?>
    <?php endforeach ?>
    <?php for($i;$i%3!=0;$i++): ?>
          <td class="empty-product">&nbsp;</td>
    <?php endfor ?>
    <?php if ($i%3==0): ?>
    </tr>
    <?php endif ?>
    </table>
    <script type="text/javascript">decorateTable('product-list-table')</script>
</div>
<?php endif; ?>
<?php echo $this->getToolbarHtml() ?>